// 自执行函数
;(function ($) {
  var $loading
  var loading = function (method) {
    if (method === "show") {
      // 当我们调用loading时显示loading
      // 生成对应的loading结构，然后append到body
      $loading = $('<div class="masking-loading"><div class="container animation-6"><div class="shape shape1"></div><div class="shape shape2"></div><div class="shape shape3"></div><div class="shape shape4"></div></div></div>')

      $loading.appendTo('body')
    } else if (method === "hide") {
      $loading.remove()
      $loading = null
    }
    
  }


  $.extend({
    loading: loading
  })
}(jQuery))